const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    entry: './src/index.js',

    output: {
        path: path.resolve(__dirname, 'public'),
        filename: 'bundle.js'
    },

    devtool: 'eval-source-map',

    devServer: {
      hot: true,
      open: true,
      static: './public',
      port: 8888
    },

    module: {
        rules: [
            {
                test: /\.less$/,
                use: ['style-loader', 'css-loader', 'less-loader']
            }
        ]
    },

    plugins: [
        new HTMLWebpackPlugin({
            template: "./public/index.html"
        })
    ]
}